import { request } from '@/api/REQ'

const modulePrefix = '/project'

/* 查看项目 */
export function getProjects(parameter: object) {
	return request({
		url: modulePrefix,
		method: 'get',
		params: parameter,
	})
}
/* 增加项目 */
export function addProject(data: object) {
	return request({
		url: modulePrefix,
		method: 'post',
		data: data,
	})
}
/* 更新项目 */
export function editProject(data: object) {
	return request({
		url: modulePrefix +`/update`,
		method: 'post',
		data: data,
	})
}
/* 删除项目 */
export function deleteProject(id: number) {
	return request({
		url: modulePrefix +`/delete/${id}`,
		method: 'delete',
	})
}

export default {
	getProjects,
	addProject,
	editProject,
	deleteProject,
}
